<!DOCTYPE html>
<html>
<head>
    <title>系统信息列表</title>
    <style>



    </style>


    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css">
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/travel.css"/>
    <script src="/js/plugins/jrender/jrender.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog/dialog.css">
    <script src="/js/plugins/dialog/dialog.min.js"></script>
    <script src="/js/common.js"></script>
    <script>
        $(function () {
            var currentPage = 1; // 当前页
            var pages; // 总页数
            var msg; // 当前页面的所有拼论

            var user = JSON.parse(sessionStorage.getItem("user"));
            // 获取用户系统信息
            $.get("/users/" + user.id + "/systemMsg", {pageSize: 10}, function (data) {
                $(".systmenMsg").renderValues(data);
                pages = data.pages;
                msg = data.list;
            });

            //当屏幕滚动最底部的时候执行函数
            $(window).scroll(function () {
                //判断是否到底
                if (isEnd()) {
                    //判断是否有下一页
                    if (currentPage < pages) {
                        currentPage++;
                        $.get("/users/" + user.id + "/systemMsg", {currentPage: currentPage,pageSize: 10}, function (data) {
                            $.merge(msg, data.list);
                            $(".systmenMsg").renderValues({list:msg});
                        })
                    } else {
                        $(document).dialog({
                            type: "notice",
                            infoText: "已经到底部了",
                            autoClose: 2500,
                            position: "bottom"
                        });
                    }
                }
            })


        });
    </script>
</head>

<body>
<div class="search-head">
    <div class="row nav-search">
        <div class="col-2">
            <a href="/mine/message.html">
                <span><i class="fa fa-chevron-left fa-2x"></i></span>
            </a>
        </div>
        <div class="col">

            <h4><span><i class="fa fa-bell"></i>系统通知</span></h4>
        </div>
        <div class="col"></div>
    </div>
</div>


<div class="container systmenMsg">
    <div render-loop="list">
        <div class="row" >
            <div class="col">
                <hr color="orange">
                <h4><font color="orange">标题:&nbsp;&nbsp;&nbsp;</font><span render-html="list.title">title</span></h4>
                <h4><font color="orange">内容:</font></h4>
                <p render-html="list.content">
                    xxxxxxx
                </p>

                <p>
                    通知时间
                    <i class="fa fa-eye fa-fw"></i>
                    <span class="glyphicon-volume-up" render-html="list.time"></span>
                </p>
            </div>
        </div>
    </div>
</div>


</body>

</html>